package com.magicode.cms.dao.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.magicode.cms.dao.IProgramPersonRelaDao;
import com.magicode.cms.entiy.base.ProgramPersonRela;

@Service("daoprogramPersonRela")
public class ProgramPersonRelaDaoImpl extends BaseDaoImpl<ProgramPersonRela> implements IProgramPersonRelaDao {

	@Override
	public void deleteProgramPersonRelalist(String id,Boolean isPerson) {
		
		String hql = " from "+ProgramPersonRela.class.getName()+" t " ;
		String where = "" ;
		if(isPerson){
			where = " where  t.person.id = '"+id+"'" ;
		}else{
			where = " where  t.program.id = '"+id+"'" ;
		}
		List<ProgramPersonRela> vphs = commonDaoService.getListByHQL(hql+where);
		commonDaoService.deleteAll(vphs);
	}

}
